<?php
namespace Admin\Model;
use Think\Model\RelationModel;
/**
 * 领料车辆与单位及编辑人关联模型
 */
class CustomerRelationModel extends RelationModel{
	//定义主表名称
	protected $tableName='customer';
	//定义关联关系
	protected $_link=array(
		'company'=>array(
			'mapping_type'=>self::BELONGS_TO,
			'class_name'    => 'company',
			'foreign_key'=>'co_id',
			'as_fields'=>'name:company'
			),
		'manager'=>array(
			'mapping_type'=>self::BELONGS_TO,
			'class_name'    => 'manager',
			'foreign_key'=>'uid',
			'as_fields'=>'realname'
			)
		);
	
}
